Learn T-SQL Commands with Samples
Skip Navigation Links
Skip Navigation Links.
Expand DatabaseDatabase
Expand TableTable
Expand ViewView
Collapse Stored ProcedureStored Procedure
Expand Data FilteringData Filtering
Expand Data GroupingData Grouping
Expand JoinsJoins
Expand TriggerTrigger
Expand CursorCursor
Expand OperatorsOperators
Expand ConstraintsConstraints
Expand FunctionsFunctions
Expand Conditional ProcessingConditional Processing
Expand LoopingLooping
Expand Error HandlingError Handling
Expand v.IMP Queriesv.IMP Queries
Expand XMLXML
Expand Query PerformanceQuery Performance
Expand QueriesQueries
Expand NormalizationNormalization
Expand CreateCreate
     

IMP SPs

 
      
-- to Display Table info(Columns, DataTypes etc...)
EXEC sp_columns 'EMP' -- or -- EXEC sp_help 'EMP'
-- to Display a list of objects that can be queried in the current environment
EXEC sp_tables
-- to Display the Content of Stored Procedure
EXEC sp_helptext 'mySP'
-- to execute/built SQL statements/batch dynamically
EXEC sp_executesql N'SELECT * FROM EMP WHERE ID = @var', N'@var tinyint', @var = 2
-- to Provides information about current users and processes
EXEC sp_who EXEC sp_who2
-- to display types of DML triggers defined on the specified table
EXEC sp_helptrigger 'EMP'